<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/WorkspaceTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:define name="top">
        
    </ui:define>

    <ui:define name="left">
       
    </ui:define>

    <ui:define name="right">
       
    </ui:define>

    <ui:define name="content">
        <h:form>
            <p:panel header="Message Information">
                <p:messages showDetail="true"/>
                <h:panelGrid columns="3">
                    <h:outputLabel value="Subject: *"/>
                    <p:inputText id="subject" required="true" requiredMessage="Subject is compulsory"
                                 value="#{msgManagerBean.repliedMsg.subject}"/>
                    <p:message for="subject"/>

                    <h:outputLabel value="Sender: "/>
                    <h:outputText value="#{msgManagerBean.getSelectedMsgStaffName(msgManagerBean.repliedMsg.senderAccId)}"/>
                    <h:outputText value=""/>

                    <h:outputLabel value="Sent To: "/>
                    <h:outputText value=""/>
                    <h:outputText value=""/>

                    <c:forEach items="#{msgManagerBean.repliedMsg.receiverAccIds}" var="raid" varStatus="forLoop">
                        <h:outputText value=""/>
                        <h:outputText value="#{msgManagerBean.getSelectedMsgStaffName(raid)}"/>
                        <h:outputText value=""/>
                    </c:forEach>
                </h:panelGrid>
            </p:panel>

            <p:panel header="Message Content">
                <p:editor value="#{msgManagerBean.repliedMsg.content}"/>
            </p:panel>
            <p:commandButton value="Reply Now" ajax="false" action="#{msgManagerBean.replyMessage}"/>
            <p:commandButton value="Back" onclick="javascript: history.go(-1)"/>

        </h:form>
    </ui:define>

    <ui:define name="bottom">
       
    </ui:define>

</ui:composition>
